<!DOCTYPE html>
<html lang="zh">
<head>
  <title>背景幕</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
  <link rel="stylesheet" href="../../lib/ionic/css/ionic.min.css">
</head>
<body ng-app="starter" ng-controller="myCtrl">
  <button class="button button-dark" ng-click="showBackdrop()">显示背景幕</button>

  <script src="../../lib/ionic/js/ionic.bundle.js"></script>
  <script src="../../js/app.js"></script>
  <script>
    angular.module("starter", ["ionic"]).controller("myCtrl", function ($scope, $ionicBackdrop, $timeout) {
      //显示背景幕
      $scope.showBackdrop = function () {
        $ionicBackdrop.retain();
        //2s后消失
        $timeout(function () {
          $ionicBackdrop.release();
        }, 2000)
      }
    })
  </script>
</body>
</html>
